import os
import re

##Get current path
currentDir =  os.getcwd()
parentDir = os.path.dirname(currentDir)
##Build list of files with ##PATH## 
filesInDir=os.listdir(os.getcwd())
for fname in filesInDir:
  if not os.path.isdir(fname):
    origText = open(fname).read()
    replaceText = origText.replace('##PATH##',parentDir)
    if origText != replaceText and fname != 'updatepaths.py':
      print "PATH found in " + fname  
      f = open(fname,'w')
      f.write(replaceText)
      f.close()
